#include "cppTutorLog.h"
#include "cppTutorPassingArguments.h"

#include <iostream>

extern CcppTutorLog Log;

using namespace std;

CcppTutorPassingArguments :: CcppTutorPassingArguments ()
{
    Log << "ENTER : CcppTutorPassingArguments :: CcppTutorPassingArguments ()" << endl;
    Log << "EXIT  : CcppTutorPassingArguments :: CcppTutorPassingArguments ()" << endl;
}

CcppTutorPassingArguments :: ~CcppTutorPassingArguments()
{
    Log << "ENTER : CcppTutorPassingArguments :: ~CcppTutorPassingArguments ()" << endl;
    Log << "EXIT  : CcppTutorPassingArguments :: ~CcppTutorPassingArguments ()" << endl;
}

int CcppTutorPassingArguments ::m_PassByValue(int nTemp)
{
    Log  << "ENTER : CcppTutorPassingArguments :: m_PassByValue" << endl;
	cout << "<----- Pass By Value ----->" << endl;
	cout << "Received Value " << nTemp << endl;
	nTemp ++;
    Log << "EXIT  : CcppTutorPassingArguments :: m_PassByValue" << endl;
	return 0;
}

void CcppTutorPassingArguments ::m_PassByReference(int &nrTemp)
{
    Log  << "ENTER : CcppTutorPassingArguments :: m_PassByReference" << endl;
	cout << "<----- Pass By Reference ----->" << endl;
	cout << "Received Value " << nrTemp << endl;
	nrTemp ++;
    Log  << "ENTER : CcppTutorPassingArguments :: m_PassByReference" << endl;
}

int CcppTutorPassingArguments ::m_PassByAddress(int *npTemp)
{
    Log  << "ENTER : CcppTutorPassingArguments :: m_PassByAddress" << endl;
	cout << "<----- Pass By Address ----->" << endl;
	cout << "Received Value " << *npTemp << endl;
	(*npTemp) ++;
    Log  << "ENTER : CcppTutorPassingArguments :: m_PassByAddress" << endl;
	return 0;
}